/**
 * historyEvent模块接口列表
 */

import base from './base'; // 导入接口域名列表
import axios from '../util/http'; // 导入http中创建的axios实例
import qs from 'qs'; // 根据需求是否导入qs模块

// const url = `${base.bd}/history_event`;
const historyEvent = {    
    // 历史事件信息   
    historyEventList (params) {        
        return axios.get(`${base.bd}/event/traffic/query`, {            
            params: params        
        });    
    },
    // 最新的历史事件信息
    historyEventLatestList (params) {        
        return axios.get(`${base.bd}/latest_event/query`, {            
            params: params        
        });    
    },
    // 查询历史视频
    historyEventVideoUrl (params) {        
        return axios.get(`${base.bd}/video/get`, {            
            params: params        
        });    
    },
    // 查询交通的路段
    historyEventAddress () {        
        return axios.get(`${base.bd}/traffic/road/query`);    
    },
    // 查询交通的事件类型
    historyEventType () {        
        return axios.get(`${base.bd}/traffic/type/query`);    
    },
    // 导出excel文件流
    exportExcel (params) {
        return axios.get(`${base.bd}/traffic/event/excel`,{
            params: params,
            responseType: 'blob'
        });  
    },
    // 测试------------
    addHistoryEvent (params){
        return axios.post(`${base.bd}/traffic/event/create`,params);  
    }
}

export default historyEvent;
